-- GENERATED SPELL FOR [Torloth the Magnificent] --


function spell0_22076(pUnit, Event) --@Cleave,n/a--
pUnit:FullCastSpellOnTarget(15284,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22076', 666, 1)
end

function spell1_22076(pUnit, Event) --@Shadowfury,n/a--
pUnit:FullCastSpellOnTarget(39082,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22076', 3000, 1)
end

function spell2_22076(pUnit, Event) --@Spell Reflection,Self--
pUnit:FullCastSpellOnTarget(33961,pUnit)
pUnit:RegisterEvent('Sorts_22076', 7000, 1)
end

function Sorts_22076(pUnit, Event)
local choix_sorts_22076 = math.random(0, 2)
if choix_sorts_22076 == 0 then
pUnit:RegisterEvent('spell0_22076', 1, 1)
end
if choix_sorts_22076 == 1 then
pUnit:RegisterEvent('spell1_22076', 1, 1)
end
if choix_sorts_22076 == 2 then
pUnit:RegisterEvent('spell2_22076', 1, 1)
end
end

function mob22076_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_22076', math.random(1500, 3000), 1)
end

function mob22076_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22076_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22076_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(22076, 1, 'mob22076_Action')
RegisterUnitEvent(22076, 2, 'mob22076_Leave')
RegisterUnitEvent(22076, 3, 'mob22076_Kill')
RegisterUnitEvent(22076, 4, 'mob22076_Die')
